Automatically choose next open port#7
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces an autoport feature that automatically increments the port number if the requested port is already tracked in the internal registry. It also updates function signatures to use the Integer type for ports and defines default constants. Feedback indicates that the use of warn() will cause a runtime error and must be replaced with the @warn macro. Additionally, the current port-checking logic only considers the internal registry and should be expanded to check for system-level port availability to ensure robustness.
| while autoport && haskey(SERVERS, port) | ||
| warn("Port $port is already in use, trying next port...") | ||
| port += 1 | ||
| end |
There was a problem hiding this comment.
The current implementation only checks if the port is present in the internal SERVERS dictionary. It does not check if the port is already bound by another process on the system. To more robustly find an 'open' port as the PR title suggests, you might want to handle potential 'address in use' errors during the HTTP.serve! call or use a utility to check system-level port availability.
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
…into mk/autoport
|
Yes looks better than the while loop here. Closing in favour of #8 |
Means one can do several
browzarrcalls after another to e.g. compare datasets across browser windows without manually specifying a new port